package com.example.ccjml;

import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.ccj.b.c.custom.image.IImageChangeDelete;
import com.example.ccj.b.c.custom.image.IImageChangeUpload;
import com.example.ccj.b.c.custom.image.ImageChangeListener;
import com.example.ccj.b.c.custom.image.LoadImagesRecycler;
import com.example.ccj.b.c.custom.image.MLocalMedia;
import com.example.ccj.u.LogUtils;

import java.util.List;

public class TestMapActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_test_map);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        LoadImagesRecycler loadImagesRecycler = findViewById(R.id.activity_test_map_imageview);
        loadImagesRecycler.setMode(LoadImagesRecycler.NETWORK)
            .setTag("这是提示文本")
            .setTitleName("选择图片控件")
            .setMaxSum(20)
            .setImageChangeListener(new ImageChangeListener() {
                @Override
                public void imageNetWorkDelete(MLocalMedia images, IImageChangeDelete iImageChangeDelete) {
                    LogUtils.d("imageNetWorkDelete回调");
                }

                @Override
                public void imageLocalDelete(List<MLocalMedia> aLlImages) {
                    LogUtils.d("imageLocalDelete回调");
                }

                @Override
                public void imageInsert(List<MLocalMedia> nowImages) {
                    LogUtils.d("imageInsert回调");
                }

                @Override
                public void imageInsertNetWork(List<MLocalMedia> nowImages, IImageChangeUpload iImageChangeUpload) {
                    LogUtils.d("imageInsertNetWork回调");
                }
            }).show();

    }
}